package com.xlw.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

// 在这个Service类中,封装同步适配器
public class OnRoadSyncService extends Service {

    private static final Object sSyncAdapterLock = new Object();
    private static OnRoadSyncAdapter sSyncAdapter = null;

    @Override
    public void onCreate() {
        synchronized (sSyncAdapterLock) {
            if (sSyncAdapter == null) {
                sSyncAdapter = new OnRoadSyncAdapter(getApplicationContext(),true);
            }
        }
    }

    @Override
    public IBinder onBind(Intent intent) {
        return sSyncAdapter.getSyncAdapterBinder();
    }

}
